<?php
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=topup_export.xls');

?>
<table border=1 style="font-family: Calibri; font-size: 14px; margin: 10px;">
<!-- Headers -->
<thead>
	<tr style="background: black; color: white;">
      <th>{{ $list_id }}</a></td>
      <th>{{ $list_LOGIN_id }}</a></td>
      <th>{{ $list_employee_name }}</a></td>
      <th>{{ $list_ORDER_id }}</a></td>
      <th>{{ $list_points }}</a></td>
      <th>{{ $list_order_status }}</a></td>
      <th>{{ $list_reference_number }}</a></td>
      <th>{{ $list_amount }}</a></td>
      <th>{{ $list_created_at }}</a></td>
      <th>{{ $list_payment_method }}</a></td>
      <th>{{ $list_topup_status }}</a></td>
    </tr>
 </thead> 

	@foreach($topup_list as $key=>$value)
	<tr>
		<td>{{ $value->id }}</td>
		 <td>{{ $value->LOGIN_id }}</td>
		<td>{{ $value->lastname }}, {{ $value->firstname }}</td>
		<td>{{ $value->ORDER_id }}</td>
		<td>{{ $value->points }}</td>
		<td>{{ $order_statuses[$value->order_status] }}</td>
		@if ( $value->topupInformation->count() )
		<td>@foreach ( $value->topupInformation as $topup )
						<li>{{ $topup->reference_number }}</li>
			@endforeach	
		</td>
		<td>@foreach ( $value->topupInformation as $topup )
						<li>{{ $topup->amount }}</li>
			@endforeach	
		</td>
		@else
		<td></td>
		<td></td>
		@endif
			
		<td>{{ date_format($value->created_at,"m/d/Y H:i:s")}}</td>
		<td>{{ $payment_method[$value->payment_method] }}</td>
		<td>{{ $topup_status_data[$value->topup_status] }}
		{{-- @if($value->order_status == Constant::ORDER_PROCESSING)
			{{ $text_topup_approved }}
			@elseif($value->order_status == Constant::ORDER_CANCELLED)
			{{ $text_topup_cancelled }}
			@else
			{{ $topup_status_data[$value->topup_status] }}
			@endif --}}</td> 
	</tr>
	@endforeach

</table>